<style>
    .propRommInputVal {
        -webkit-box-shadow:5px 10px 6px #acacac;
        -moz-box-shadow:5px 5px 6px #acacac;

    }
    .propRommViewVal {
        background:transparent;
        border:0;
        color:#45649E;
    }
    .propRoomVal {
        width:30px;
        margin:auto 3px auto;
    }
</style>
  <div id="roomStyleView" class='panel' >
    <div class="panelbar">
    房间
    </div>
  <ul id='roomStyleList' style="margin:10px; line-height:30px;">  
    
    <li class='prop' id='ptype'><span class='propKey'>类型 </span><span id="ptypeval" ><input id='typeval' class='propRoomVal propRommViewVal' value=''/></span></li>
    <li class='prop' id='proomstype'><span class='propKey'>中心（cm） </span><span id="pcenterxval" >X:<input id='centerxval' class='propRoomVal propRommViewVal' value=''/>Y:<input id='centeryval' class='propRoomVal propRommViewVal' value=''/></span></li>
    <li class='prop' id='psize'><span class='propKey'>尺寸（cm） </span><span id="psizeval" >X:<input id='sizexval' class='propRoomVal propRommViewVal' value=''/>Y:<input id='sizeyval' class='propRoomVal propRommViewVal' value=''/></span></li>
  </ul>
  </div>
  
<script>
    $( function() {

      /*
        $('#roomStyleView').draggable({
            cursor : 'crosshair',
            handle : ".draghandle",
            containment : '.stage',
            scroll : false
        });
    */
        var curVal=null;
        $('.prop .propRoomVal').addClass('propRommViewVal').click( function() {
            $(this).removeClass('propRommViewVal').addClass('propRommInputVal');
            curVal=$(this).val();
        }).focusout( function() {
            $(this).removeClass('propRommInputVal').addClass('propRommViewVal');
            if($(this).val().length==0) {
                $(this).val(curVal);
            } else if($(this).val()!=curVal) {
                curVal=$(this).val();
                alert($(this).attr('id'));
                switch($(this).attr('id')) {
                    case "centerxval":
                        build.structure.position.x=parseInt(curVal);
                        break;
                    case "centeryval":
                        build.structure.position.y=parseInt(curVal);
                        break;
                    case "sizexval":
                        scene.remove(build.structure);
                        var size={x:parseInt(curVal),y:parseInt($("#sizeyval").val())};
                        build.drawFloor(build.structure.position, size);
                        break;
                }
            }
        });
    });
</script>